<?php
$serverip=$_POST['serverip'];
$port=$_POST['port'];
$icesconfigcontent=$_POST['icesconfigcontent'];

function post_content ($url,$postdata) {
  $uagent = "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; .NET CLR 1.1.4322)";

  $ch = curl_init( $url );
  curl_setopt($ch, CURLOPT_URL, $url);
  curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
  curl_setopt($ch, CURLOPT_HEADER, 0);
  curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
  curl_setopt($ch, CURLOPT_ENCODING, "");
  curl_setopt($ch, CURLOPT_USERAGENT, $uagent);  // useragent
  curl_setopt($ch, CURLOPT_TIMEOUT, 120);
  curl_setopt($ch, CURLOPT_POST, 1);
  curl_setopt($ch, CURLOPT_POSTFIELDS, $postdata);
  $content = curl_exec( $ch );
  curl_close( $ch );
  return $content;
}
$url='http://'.$serverip.'/panel/usericesconf.php';
$postdata='username=user'.$port.'&icesconfigcontent='.$icesconfigcontent;
$data= post_content($url,$postdata);
  echo iconv("utf-8", "windows-1251",$data);
?>